Skip to content

feat: add warn.redundantExpose for redundant @[expose]/@[no_expose] attributes#13359

Merged
Kha merged 5 commits intoleanprover:masterfrom
Kha:push-otktnsnmrruv
Apr 27, 2026
Merged

feat: add warn.redundantExpose for redundant @[expose]/@[no_expose] attributes#13359
Kha merged 5 commits intoleanprover:masterfrom
Kha:push-otktnsnmrruv

Conversation

@Kha
Copy link
Copy Markdown
Member

@Kha Kha commented Apr 10, 2026

This PR adds a linter.redundantExpose option (default true) that warns when @[expose] or @[no_expose] attributes have no effect:

  • @[expose] on abbrev (always exposed) or non-Prop instance (always exposed)
  • @[expose] on a def inside an @[expose] section (already exposed by the section)
  • @[expose]/@[no_expose] in a non-module file (no module system)
  • @[no_expose] on a declaration that wouldn't be exposed by default

@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 10, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

leanprover-bot commented Apr 10, 2026

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-07 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-10 14:56:41)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-27 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-27 11:04:45)

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 2026
@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 10, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 10, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Apr 10, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

mathlib-lean-pr-testing Bot commented Apr 10, 2026

Mathlib CI status (docs):

  • 💥 Mathlib branch lean-pr-testing-13359 build failed against this PR. (2026-04-10 15:47:46) View Log
  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-04-27 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-27 11:04:43)

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha force-pushed the push-otktnsnmrruv branch from 663798c to 8400f35 Compare April 13, 2026 09:14
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 13, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha added the awaiting-mathlib We should not merge this until we have a successful Mathlib build label Apr 14, 2026
@Kha Kha marked this pull request as ready for review April 14, 2026 20:46
@Kha Kha marked this pull request as draft April 14, 2026 20:47
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed awaiting-mathlib We should not merge this until we have a successful Mathlib build breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Apr 14, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

@Kha Kha force-pushed the push-otktnsnmrruv branch from 8400f35 to 3a28af6 Compare April 17, 2026 11:16
…pose]` attributes

This PR adds a `linter.redundantExpose` option (default `true`) that warns
when `@[expose]` or `@[no_expose]` attributes have no effect:

- `@[expose]` on `abbrev` (always exposed) or non-Prop `instance` (always
  exposed)
- `@[expose]` on a `def` inside an `@[expose] section` (already exposed by
  the section)
- `@[expose]`/`@[no_expose]` in a non-`module` file (no module system)
- `@[no_expose]` on a declaration that wouldn't be exposed by default

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kha Kha force-pushed the push-otktnsnmrruv branch from 3a28af6 to 3bce27f Compare April 17, 2026 11:34
@Kha Kha changed the title feat: add linter.redundantExpose for redundant @[expose]/@[no_expose] attributes feat: add warn.redundantExpose for redundant @[expose]/@[no_expose] attributes Apr 17, 2026
@Kha Kha marked this pull request as ready for review April 17, 2026 11:35
@Kha Kha enabled auto-merge April 17, 2026 11:35
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 17, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 17, 2026
@Kha Kha added the changelog-language Language features and metaprograms label Apr 17, 2026
@Kha Kha added this pull request to the merge queue Apr 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 17, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 17, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 17, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha enabled auto-merge April 17, 2026 15:04
@Kha Kha added this pull request to the merge queue Apr 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 17, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 17, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 17, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha requested review from TwoFX, datokrat, kim-em and tydeu as code owners April 27, 2026 10:18
@Kha Kha enabled auto-merge April 27, 2026 10:18
@Kha Kha added this pull request to the merge queue Apr 27, 2026
Merged via the queue into leanprover:master with commit 7f5fac9 Apr 27, 2026
19 checks passed
@Kha Kha deleted the push-otktnsnmrruv branch April 29, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants